num = int(input())
a = num//1000000
b=num//1000%1000
c=num%1000
print(a,b,c,sep=" ")